package org.example.gradleadmin.rpc.rest;

import gradle.common.core.mode.entity.SystemPermissions;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.gradleadmin.rpc.service.SystemPermissionsRestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/service/permissions")
public class SystemPermissionsRest {

    @Resource
    private SystemPermissionsRestService permissionsRestService;

    @GetMapping("/queryIdListPermByUserId")
    List<Long> queryIdListPermByUserId(@RequestParam("id") Long id){
        return permissionsRestService.queryIdListPermByUserId(id);
    }

    @GetMapping("/queryPermAll")
    List<SystemPermissions> queryPermAll(){
        return permissionsRestService.queryPermAll();
    }
}
